<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSocialitesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('socialites', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('driver');                    // 第三方应用名称（weibo qq..）
            $table->string('open_id');                   // 第三方应用的唯一标识）
            $table->string('from')->nullable();                      // 推荐用户的open_id
            $table->text('auth_info')->nullable();       // 第三方返回信息
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('socialites');
    }
}
